<! DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>求红白黑球个数</title>
</head>
<body>
<script>
    for(var white=0;white<=31;white++){
        var red=25-white;
        var black=31-white;
        if(28==red+black){
            alert('红球：'+red+'\n'+'白球:'+white+'\n'+'黑球：'+black);
        }
    }
    
</script>
</body>
</html>
